<?php
	if (isset($_GET['CID'])) {
		$OBJCTCL = $_GET['CID'];
	} elseif (isset($_POST['OBJCTCL'])) {
		$OBJCTCL = $_POST['OBJCTCL'];
	}
if (!isset($_GET['cAlert_ID']))  {
	$_POST['PrfAlert'] = req_form($_POST['PrfAlert']);
	if ($_POST['PrfAlert'] != '') {
	$GLOBALS['MYT']->db_query("UPDATE hc_prfalerts SET Status = 6
			WHERE RefClient = {$_POST['OBJCTCL']} AND Status = 2");
	$GLOBALS['MYT']->db_query("INSERT INTO hc_prfalerts (sysTime, RefUser, RefClient, TYPE, Msg)
				VALUES	('{$sysTime}',{$_SESSION[$SESSID]},{$OBJCTCL},{$_POST['PrfAlert_Type']},'{$_POST['PrfAlert']}');");

	}
} else {
$GLOBALS['MYT']->db_query("UPDATE hc_prfalerts SET Status = 6
			WHERE REF = {$_GET['cAlert_ID']}");

}
	echo '<script charset="utf-8" type="text/javascript">
	document.ClientProperties.action=\'_response/call.php?get=Operative/view/viewclientalerthistory&CID='.$OBJCTCL.'\';
	subform(\'ClientProperties\',\'Prf_Alerts\');
	</script>';